Practical Applications of Precedence Graph Grammars
نویسنده
چکیده
Precedence graph grammars are of major interest in all those applications of graph grammars, where highly efficient parsers are needed. Up to now there are no other graph parsers with the same performance. Due to the fact, that even regular graph grammars with very restricted embedding relations have a NP-complete membership problem, different kinds than Chomsky-like restrictions have to be imposed on graph grammars. We start with contextfree graph grammars and introduce precedence relations. By demanding conflictfreeness, unique invertibility and some further, more technical constraints, precedence graph grammars are introduced with an O(n2) membership problem, where n ist the number of nodes of the input graph.Precedence graph grammars are unambiguous, which is especially important for semantic evaluation of the derivation trees. In this paper we show, that in spite of all constraints the proposed graph grammar class has interesting generative power, concerning applications in such areas as e.g. dynamic data structures, program graphs, data and control flow graphs and syntactic pattern recognition. For the last topic an error correcting facility incorporated into the precedence graph parser is of special interest. In general inexact graph matching is NP-complete. In this paper we present a method, that increases the time complexity of our parser only by a factor of n. At last, our method is demonstrated with an example from syntactic pattern recognition.
منابع مشابه
PAPAGENO: A Parallel Parser Generator for Operator Precedence Grammars
In almost all language processing applications, languages are parsed employing classical algorithms (such as the LR(1) parsers generated by Bison), which are sequential due to their left-to-right state-dependent nature. Although early theoretical studies on parallel parsing algorithms delineated potential speedups on abstract parallel machines using a data-parallel approach, practical developme...
متن کاملBidirectional Model Transformation with Precedence Triple Graph Grammars
Triple Graph Grammars (TGGs) are a rule-based technique with a formal background for specifying bidirectional model transformation. In practical scenarios, the unidirectional rules needed for the forward and backward transformations are automatically derived from the TGG rules in the specification, and the overall transformation process is governed by a control algorithm. Current implementation...
متن کاملCan Graph Grammars Make Formal Methods More Human?
Formal methods are scarcely used in industrial applications. Industrial strength tools and educational effort do not significantly help in promoting formal methods. Main obstacles to the industrial application of formal methods are lack of flexibility, lack of specialization, and difficulties in interpreting analysis results. This paper argues that graph grammars can help overcoming such limita...
متن کاملConstructing Confluent Context-sensitive Graph Grammars from Non-confluent Productions for Parsing Efficiency
The efficient parsing algorithms are usually confined to confluent graph grammars in context-sensitive formalisms, whereas the confluence condition is not frequently met by graph grammars in practical applications. This paper, based on the Reserved Graph Grammar (RGG) formalism, proposes an extended formalism XRGG which allows imposing constraints characterizing application situations on graph ...
متن کاملSimple LR ( k ) Grammars Franklin
A class of context-free grammars, called the "Simple LR(k)" or SLR(k) grammars is defined. This class has been shown to include weak precedence and simple precedence grammars as proper subsets. How to construct parsers for the SLR(k) grammars is also shown. These parser-construction techniques are extendible to cover all of the LR(k) grammars of Knuth; they have been implemented and by direct c...
متن کامل